﻿@model Benecura.Interfaces.Web.Models.ScheduleWeek
@using Benecura.Interfaces.Web.Classes.Helper.Extensions
@using Benecura.Interfaces.Web.Models
@{
    ViewBag.Title = @Model.DateRange;
    var currentDaysDiff = Convert.ToInt32(Url.GetRouteValue("diff"));
}
@section PageNav
{
    <div data-role="navbar" data-iconpos="left">
        <ul>
            <li>@Html.ActionLink("Back", "MyWeek", "Schedule", new { parentid = "test", diff = currentDaysDiff - 1 }, new { data_icon = "arrow-l" })</li>
            <li>@Html.ActionLink("Current", "MyWeek", "Schedule", new { parentid = "test", diff = 0 }, new { data_icon = "star" })</li>
            <li>@Html.ActionLink("Next", "MyWeek", "Schedule", new { parentid = "test", diff = currentDaysDiff + 1 }, new { data_icon = "arrow-r" })</li>
        </ul>
    </div>
}
<ul data-role="listview" data-inset="true">
    @foreach (ScheduleDay scheduleDay in Model.WeekDays)
    {
        var eventCount = scheduleDay.GetEventCount();
        <li @if (scheduleDay.Date.IsToday())
            {
                 <text>data-theme="e"</text> 
            }
            else if (scheduleDay.Date.DayOfWeek.Equals(DayOfWeek.Saturday) || scheduleDay.Date.DayOfWeek.Equals(DayOfWeek.Sunday))
            {
                 <text>data-theme="b"</text> 
            }>@Html.ActionLink(
                string.Format("{0} - {1}",
                    scheduleDay.Date.DayOfWeek.ToString().Substring(0, 3).ToUpper(),
                    scheduleDay.Date.ToString("dd/MMM")), "Index", "Schedule")
            @if (eventCount > 0)
            {
                <span class="ui-li-count">@eventCount</span>
            }
        </li>
    }
</ul>
